//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <regs.h>

LEAF(__UserStartUpEntry)
    addiu  $29, $29, -0x20;
    sw     $4, 0x20($29);
    sw     $5, 0x24($29);
__UserStartUpEntry_1:
    lw     $3, 0x20($29);
    lw     $4, 4($3);
    beq    $0, $4, __UserStartUpEntry_2;
    lw     $3, 0($3);
    lw     $5, 0x24($29);
    li     $6, 0;
    jalr   $3;
    lw     $2, 0x20($29);
    addiu  $2, $2, -0x8;
    sw     $2, 0x20($29);
    b      __UserStartUpEntry_1;
__UserStartUpEntry_2:
    // Call SysExitThread
    li     $4, 0;
    li     $3, 1;
    li     $2, 0xb;
    syscall;
END(__UserStartUpEntry)
